package com.example.administrator.xtu_community.utils;

import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.widget.TextView;

public class AnimatorUtils {

    public static void cancleTabAnimator(TextView tvTab) {
        PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1.3f, 1f);
        PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1.3f, 1f);
        PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat("alpha", 1.0f, 0.8f);
        ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(tvTab, scaleX, scaleY, alpha);
        animator.setDuration(500);
        animator.start();
    }

    public static void startTabAnimator(TextView tvTab) {
        PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 1.3f);
        PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 1.3f);
        PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat("alpha", 0.8f, 1.0f);
        ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(tvTab, scaleX, scaleY, alpha);
        animator.setDuration(500);
        animator.start();
    }
}
